1. Field of the Invention
The present invention relates to a virtual memory managing system for managing swap-out/swap-in relating to physical memory areas in a main storage device, segments in virtual memory space, and swap files in an auxiliary storage device in a virtual memory system.
2. Description of the Related Art
When swap-out became necessary in a virtual memory system, virtual memory managing systems of this type of the prior art carried out swap-out in page units. (Physical storage areas in a main memory device, segments in virtual memory space, and swap files in an auxiliary storage device are hereinbelow referred to as xe2x80x9cmemory areas.xe2x80x9d)
When carrying out swap-out by page units in a virtual memory managing system of the prior art, a method is commonly adopted in which swap-out is performed by, for example, an algorithm that takes the page in use as LRU (Least Recently Used) to effectively carry out swap-out and swap-in of pages.
A virtual memory managing system of the prior art as described above, however, has the following problems.
First, because swap-out is carried out in page units by an algorithm such as LRU, swap-out of a page is carried out for the first time after page data (data within a page) have gone unused for a long time and have become old. The problem, therefore, is the existence of a certain amount of hold time until a page that actually is no longer used in tasks is swapped out. In other words, there was a problem of inefficient use of time in the memory management in a virtual memory system.
A second problem is that swap-out was carried in page units even when a task required that a memory area of large capacity be reserved, and swap-out of pages therefore had to be carried out repeatedly to reserve the necessary memory area. In other words, there was a problem of inefficient use of space in the memory management in the virtual memory system.
In view of the above-described problems, it is an object of the present invention to provide a virtual memory management system that enables memory management that is efficient in terms of both time and space in a virtual memory system through a xe2x80x9ccombination of swap-out in page units and swap-out in task units.xe2x80x9d
Patent Gazette publications relating to the prior art of this invention include Japanese Patent Laid-open No. 25645/91, Japanese Patent Laid-open No. 174637/91, and Japanese Patent Laid-open No. 89221/94.
Japanese Patent Laid-open No. 25645/91 (Virtual Space Swapping System) relates to a technique in an information processing system that includes multiple virtual space and that manages this virtual space by segments and pages (pages being subdivided segments), the number of referenced pages (pages referenced in the relevant segment) being counted by segment, and swap-in being carried out while giving priority to segments having a large number of referenced pages so as to limit the total number of swapped-in pages. Although this technique shares with the present invention the object of providing efficient control of swap-out/swap-in, it differs entirely in terms of both viewpoint and constitution because it seeks to improve the swapping efficiency by reducing the number of swapped-in pages based on the count of referenced pages, in contrast to the present invention, which seeks to improve efficiency of swapping through xe2x80x9cthe combination of swap-out by page units and swap-out by task units.xe2x80x9d
The technique of Japanese Patent Laid-open No. 174637/91 (Virtual Storage Control Method and Device) enables the reuse of used areas of a page when swapping out by preventing the erasing of these pages that are once recorded in an auxiliary storage device when swapping-in. This technique also shares with the present invention the object of efficient control of swap-out/swap-in. However, when swapping out, this technique determines whether or not areas of an auxiliary memory device can be reused and then determines whether areas are to be reused or newly reserved, and this technique therefore differs in terms of both viewpoint and constitution from the present invention, which seeks to improve efficiency of swapping out through xe2x80x9cthe combination of swap-out by page units and swap-out by task units.xe2x80x9d In addition, when there is a request from a task to reserve memory areas, the present invention reserves areas within an auxiliary storage device (swap files) and at the same time reserves physical memory areas on a one-to-one basis, and the present invention therefore dues not require determination of whether or not areas of an auxiliary storage device are to be reused, as in the above-described art in the patent gazette.
Finally, Japanese Patent Laid-open No. 89221/94 (Computer System Memory Managing Method and Device) carries out judgments based on history information that has been made a vector (information recorded in a swap vector) when selecting pages that are to be paged out. Although this technique shares with the present invention the objective of efficient control of swap-out/swap-in, this technique seeks this improved efficiency through appropriate selection of pages that are to be paged out and therefore differs entirely in both viewpoint and constitution from the present invention, which seeks to improve efficiency of swapping through the xe2x80x9ccombination of swap-out in page units and swap-out in task units.xe2x80x9d
Each of the above-described cases of the prior art has an entirely different constitution from the present invention as described hereinabove, and it goes without saying that even a combination of these cases of the prior art would not arrive at the technical idea of the present invention.
The virtual memory managing system of the present invention includes in a virtual memory system:
swap management tables provided with the items: page tag, update bit, and copy bit for each page;
memory area reserving means for, based on a memory area reserve request from a task, producing and managing the swap management table that corresponds to that memory area reserve request;
reserving, for that memory area reserve request, physical memory areas in a main storage device, segments in virtual memory space, and swap files in an auxiliary storage device;
and setting information in the swap management tables by means of the reservation of these memory areas;
swap-out control means for, when swap-out becomes necessary, determining whether swap-out should be carried out in page units or batch swap-out should be carried out in task units;
controlling and executing swap-out based on this determination;
and setting information indicating that pages that are subject to swap-out have been copied to swap files in the auxiliary storage device in copy bits for these pages in the swap management tables;
memory writing managing means for, when data within the pages have been updated, setting information indicating update of these pages in update bits for these pages in the swap management tables; and
swap-out object limiting means for effecting control such that, when batch swap-out is carried out in task units under the control of the swap-out control means, swap-out is not carried out for xe2x80x9cpages that have been copied without being updatedxe2x80x9d based on update bits and copy bits in the swap management tables.
In more general terms, the virtual memory managing system of the present invention can be described as a construction in a virtual memory system having: a memory area reserving means for, based on a memory area reserve request from a task, reserving physical memory areas of a main storage device, segments in virtual memory space, and swap files in an auxiliary storage device; and swap-out control means for, when swap-out becomes necessary, determining whether swap-out should be carried out in page units or batch swap-out should be carried out in task units (for example, a determination to carry out swap-out in task units if the memory size of memory areas that are the requested object of the memory area reserve request that has brought about swap-out is greater than a reference value), and controlling and executing swap-out based on this determination (for example, control for selecting pages to be subjected to swap-out by an algorithm such as LRU if it has been determined that swap-out should be carried out in page units, and control for selecting the task to be subjected to swap-out by an algorithm such as averaged LRU for the group of used pages if it has been determined that swap-out should be carried out in task units).
Further, the virtual memory managing system of the present invention can be realized as a record medium on which is recorded a program for causing a computer in a virtual memory system to function as a memory area reserving means that, based on a memory area reserve request from a task, reserves physical memory areas in a main storage device, segments in virtual memory space, and swap files in an auxiliary storage device; and a program for causing the computer to function as the swap-out control means that, when swap-out becomes necessary, determines whether swap-out should be carried out in page units or batch swap-out should be carried out in task units, and then controls and executes swap-out based on this determination.
As explained hereinabove, the present invention has the following merits:
As a first merit, the present invention can efficiently carry out the reserving and management of memory areas used in a task in a virtual memory system.
This effect is obtained because the present invention can effect memory area reserving and management that is efficient in terms of both time and space by appropriately combining swap-out in page units with swap-out in task units and enabling control in which batch swap-out is carried out in task units without swapping page by page when it is determined that a memory area having a large memory size is required all at once.
As the second merit, the present invention enables still greater efficiency of swapping-out when carrying out batch swap-out in task units that offers the above-described merit.
This merit is obtained because control is effected when carrying out batch swap-out in task units such that swap-out is carried out only for pages other than pages that have already been swapped out (pages that do not require swap-out), thereby allowing a lightening of the swap-out load.
The above and other objects, features, and advantages of the present invention will become apparent from the following description based on the accompanying drawings which illustrate examples of preferred embodiments of the present invention.